package com.hspedu.extend_.Exercise;

/*1.编写 Computer 类，包含 CPU、内存、硬盘等属性，
    getDetails 方法用于返回 Computer 的详细信息
 */
public class Computer {
     private String cpu ;
     private String memory ;
     private String hardDisk;

    public Computer(String cpu, String memory, String hardDisk) {
        setCpu(cpu);
        setMemory(memory);
        setHardDisk(hardDisk);
    }

    public String getCpu() {
        return cpu;
    }

    public void setCpu(String cpu) {
        this.cpu = cpu;
    }

    public String getMemory() {
        return memory;
    }

    public void setMemory(String memory) {
        this.memory = memory;
    }

    public String getHardDisk() {
        return hardDisk;
    }

    public void setHardDisk(String hardDisk) {
        this.hardDisk = hardDisk;
    }

    //用于返回Computer的详细详细
    public String getDetails(){
        return "CPU：" + cpu + "\nMemory："+memory + "\nHardDisk：" + hardDisk;
    }
}
